#pragma once

#include "IXFrame.h"

enum HeaderFlags
{
    HF_None,
    HF_Fixed = 0x1,
    HF_Sortable = 0x2,
};

/**
 *  IXHeader Interface.
 *
 */
class ExportXSkinLib IXHeader : public IXFrame
{
    DEF_INTERFACE(IXHeader, _T("{EF9DEA55-D882-4cb5-9D56-410F5954309A}"));

public:
    virtual int  STDMETHODCALLTYPE   InsertItem(IN int nIndex, IN LPCTSTR szText) = 0;
    virtual int  STDMETHODCALLTYPE   InsertItem(IN int nIndex, IN LPCTSTR szText, IN DWORD dwTextEnvFlags, IN int nWidth) = 0;

    virtual int  STDMETHODCALLTYPE   GetItemCount() = 0;

    virtual int  STDMETHODCALLTYPE   GetItemWidth(IN int nIndex) = 0;
    virtual void STDMETHODCALLTYPE   SetItemWidth(IN int nIndex, IN int nWidth) = 0;
    virtual int  STDMETHODCALLTYPE   GetTotalWidth() = 0;

    virtual DWORD STDMETHODCALLTYPE  GetItemData(IN int nIndex) = 0;
    virtual void STDMETHODCALLTYPE   SetItemData(IN int nIndex, IN DWORD dwData) = 0;

    virtual void STDMETHODCALLTYPE   RemoveItem(IN int nIndex) = 0;
    virtual void STDMETHODCALLTYPE   RemoveAllItems() = 0;

    virtual void STDMETHODCALLTYPE   SetItemFlags(IN int nIndex, IN DWORD dwFlags) = 0;
    virtual DWORD STDMETHODCALLTYPE  GetItemFlags(IN int nIndex) = 0;

    virtual int  STDMETHODCALLTYPE   GetSortIndex() = 0;
    virtual BOOL STDMETHODCALLTYPE   GetSortAsc() = 0;
};

struct stHeaderWidthChangedEventInfo
{
    int nItemIndex;
    int nItemWidth;
};

// lParam: stHeaderWidthChangedEventInfo*
#define HeaderEvent_WidthChanged     _T("EvtHeaderWidthChanged")

struct stHeaderClickedEventInfo
{
    int     nItemIndex;
    BOOL    bAsc;
};
// lParam: stHeaderClickedEventInfo*
#define HeaderEvent_Clicked          _T("EvtHeaderClicked")
